package hxg.stream.characterStream;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @author HeXiangGuang
 * @create 2021-06-28 23:29
 */
public class Demo6 {
    public static void main(String[] args) throws IOException {
        FileWriter fw = new FileWriter("d:\\buffer2.txt");
        BufferedWriter bw = new BufferedWriter(fw);
        for (int i = 0; i < 10; i++) {
            bw.write("好好学习，天天向上！");
            bw.newLine();//写入一个换行符 window等于\r\n linux \n
            bw.flush();
        }
        bw.close();
        fw.close();
    }
}
